package com.rd.student.jike.class2.lihongming.Day0804;

import java.util.concurrent.*;

/**
 * @Auther:Heinrich
 * @Date:2023/8/4-08-04-16:08
 * @Description:com.rd.student.jike.class2.lihongming.Day0804
 * @version:1.0
 */
public class Singel {
    private static final int MIN_SIZE = 1;
    private static final int ZERO = 0;
    public static void main(String[] args) {
        int THREAD_NUM = 10 ;
        //单一线程
        ThreadPoolExecutor executor = new ThreadPoolExecutor(MIN_SIZE, MIN_SIZE,
                0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>());
        //无限线程
        ThreadPoolExecutor executor1 = new ThreadPoolExecutor(0, Integer.MAX_VALUE,
                60L, TimeUnit.SECONDS,
                new SynchronousQueue<Runnable>());
        //定量线程
        ThreadPoolExecutor executor2 = new ThreadPoolExecutor(THREAD_NUM, THREAD_NUM,
                0L, TimeUnit.MILLISECONDS,
                new LinkedBlockingQueue<Runnable>());
    }
}
